from PyCmpltrtok.common import sep

sep('a-f, 1-5')
list01 = list('abcdef')
list02 = range(1, 5+1)

sep('dict zip')
r = zip(list01, list02)
print(r)
print(list(r))

r = zip(list01, list02)
xdict = dict(r)
print(xdict)

sep('list zip')
r = zip(list01, list02)
xlist = list(r)
print(xlist)

sep('list from vocab_.items()')
xlist = [('<UNK>', 0), ('the', 1), ('rock', 2), ('is', 3), ('destined', 4), ('to', 5)]
print(*xlist)  # ('<UNK>', 0) ('the', 1) ('rock', 2) ('is', 3) ('destined', 4) ('to', 5)

r = zip(*xlist)
# xdict = dict(r)  # ValueError: dictionary update sequence element #0 has length 6; 2 is required
print(list(r))

sep('list zip star')
r = zip(*xlist)
xlist = list(r)  # [('<UNK>', 'the', 'rock', 'is', 'destined', 'to'), (0, 1, 2, 3, 4, 5)]
print(xlist)
sep('list list zip star')
xlistlist = list(xlist)
print(xlistlist)

r = zip(xlist)
# xdict = dict(r)  # ValueError: dictionary update sequence element #0 has length 1; 2 is required

sep('list zip')
r = zip(xlist)
xlist = list(r)
print(xlist)